package utils

// StringEmpty 检查字符串是否为空
func StringEmpty(s ...string) bool {
	for i := 0; i < len(s); i++ {
		if s[i] == "" || s[i] == " " {
			return true
		}
	}
	return false
}

func RedisHMGet(key string, field ...string) []interface{} {
	res, err := RedisDB.HMGet(RedisContext, key, field...).Result()
	if err != nil {
		return nil
	}
	return res
}

func RedisHGetAll(key string) map[string]string {
	res, err := RedisDB.HGetAll(RedisContext, key).Result()
	if err != nil {
		return nil
	}
	return res
}

func RedisSetHM(key, field string, value ...interface{}) {
	RedisDB.HMSet(RedisContext, key, field, value)
}
